<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:sijyp="http://java.sun.com/jsf/composite/sijyp"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:panelGrid id="panelLd" width="100%">
	
		<ui:param name="disableTableEditCommands"
			value="#{limitacionDominioBienManager.reading or bienManager.reading}" />

		<script type="javascript">
addTextAreaCounterByClass();</script>

		<h:panelGrid columns="4" width="100%"
			columnClasses="tenenciaFirstColumn, , , ">
			<ui:include src="/general/topBienesFormsFields.xhtml">
				
				<ui:param name="disabledFechaRegistro"
					value="#{disableTableEditCommands}" />
				<ui:param name="etapaGestionValue"
					value="#{bienTenenciaManager.bienTenencia.bien.tpEtapaGestion.nombre}" />
				<ui:param name="requiredEtapaGestion" value="false" />
				<ui:param name="disabledEtapaGestion" value="true" />
				<ui:param name="prepId" value="ld" />
			</ui:include>
		</h:panelGrid>
		<hr />
		<h:panelGrid width="100%">
			<ui:include src="limitacionDominioFields.xhtml" />
		</h:panelGrid>

		<ui:remove>Botones</ui:remove>
		<h:panelGroup style="text-align:center;" layout="block">
			<h:commandButton
				value="#{limitacionDominioBienManager.creating ? msg['boton.adicionar'] : (limitacionDominioBienManager.updating ? msg['boton.modificar'] : '')}"
				action="#{limitacionDominioBienManager.guardarLd}"
				rendered="#{not disableTableEditCommands}">
				<f:ajax execute="@this panelLd" render=":sijypMessages panelLd" />
			</h:commandButton>

			<h:commandButton value="${msg['boton.cancelar']}"
				action="#{limitacionDominioBienManager.clearAll}"
				rendered="#{not bienManager.reading}">
				<f:ajax render="panelLd :sijypMessages" execute="@this" />
			</h:commandButton>
		</h:panelGroup>

		<br />

		<hr align="center" width="80%" />

		<ui:include src="limitacionDominioTable.xhtml">
		</ui:include>

		<sijyp:confirmDialog message="${msg['general.confirmaBorrar']}"
			confirmId="confirmDeleteLd"
			renderComponents="confirmDeleteLd :sijypMessages :formTabs:panelLd"
			acceptAction="#{limitacionDominioBienManager.deleteLd}" />

	</h:panelGrid>
</ui:composition>
